Use IPC_RMID _after_ doing XShmAttach. This should work everywhere, and
authorOwen Taylor <otaylor@redhat.com>
Mon, 7 Dec 1998 19:03:10 +0000 (19:03 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Mon, 7 Dec 1998 19:03:10 +0000 (19:03 +0000)
Mon Dec  7 13:38:06 1998  Owen Taylor  <otaylor@redhat.com>

* gdk/gdkimage.c (gdk_image_new): Use IPC_RMID
_after_ doing XShmAttach. This should work everywhere,
and avoid the need for signal handlers or configure
checks.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/gdkimage.c
gdk/x11/gdkimage-x11.c
gtk/gtkinputdialog.c

index 7f26956e6b108f9d5e60ac3fc069ce7ddb84e418..b43cd4ae848ddc9ae8407d7ab1fd0e217b62cb3d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Mon Dec  7 13:38:06 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkimage.c (gdk_image_new): Use IPC_RMID
+       _after_ doing XShmAttach. This should work everywhere,
+       and avoid the need for signal handlers or configure
+       checks.
+
+Thu Dec  3 19:58:45 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkinputdialog.c: Use _add_with_viewport() for
+       scrolled window contents.
+
 1998-12-07  Federico Mena Quintero  <federico@nuclecu.unam.mx>
 
        * gtk/gtkpaned.h (struct _GtkPaned): Removed the unused cursor
index 7f26956e6b108f9d5e60ac3fc069ce7ddb84e418..b43cd4ae848ddc9ae8407d7ab1fd0e217b62cb3d 100644 (file)
@@ -1,3 +1,15 @@
+Mon Dec  7 13:38:06 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkimage.c (gdk_image_new): Use IPC_RMID
+       _after_ doing XShmAttach. This should work everywhere,
+       and avoid the need for signal handlers or configure
+       checks.
+
+Thu Dec  3 19:58:45 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkinputdialog.c: Use _add_with_viewport() for
+       scrolled window contents.
+
 1998-12-07  Federico Mena Quintero  <federico@nuclecu.unam.mx>
 
        * gtk/gtkpaned.h (struct _GtkPaned): Removed the unused cursor
index 7f26956e6b108f9d5e60ac3fc069ce7ddb84e418..b43cd4ae848ddc9ae8407d7ab1fd0e217b62cb3d 100644 (file)
@@ -1,3 +1,15 @@
+Mon Dec  7 13:38:06 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkimage.c (gdk_image_new): Use IPC_RMID
+       _after_ doing XShmAttach. This should work everywhere,
+       and avoid the need for signal handlers or configure
+       checks.
+
+Thu Dec  3 19:58:45 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkinputdialog.c: Use _add_with_viewport() for
+       scrolled window contents.
+
 1998-12-07  Federico Mena Quintero  <federico@nuclecu.unam.mx>
 
        * gtk/gtkpaned.h (struct _GtkPaned): Removed the unused cursor
index 7f26956e6b108f9d5e60ac3fc069ce7ddb84e418..b43cd4ae848ddc9ae8407d7ab1fd0e217b62cb3d 100644 (file)
@@ -1,3 +1,15 @@
+Mon Dec  7 13:38:06 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkimage.c (gdk_image_new): Use IPC_RMID
+       _after_ doing XShmAttach. This should work everywhere,
+       and avoid the need for signal handlers or configure
+       checks.
+
+Thu Dec  3 19:58:45 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkinputdialog.c: Use _add_with_viewport() for
+       scrolled window contents.
+
 1998-12-07  Federico Mena Quintero  <federico@nuclecu.unam.mx>
 
        * gtk/gtkpaned.h (struct _GtkPaned): Removed the unused cursor
index 7f26956e6b108f9d5e60ac3fc069ce7ddb84e418..b43cd4ae848ddc9ae8407d7ab1fd0e217b62cb3d 100644 (file)
@@ -1,3 +1,15 @@
+Mon Dec  7 13:38:06 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkimage.c (gdk_image_new): Use IPC_RMID
+       _after_ doing XShmAttach. This should work everywhere,
+       and avoid the need for signal handlers or configure
+       checks.
+
+Thu Dec  3 19:58:45 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkinputdialog.c: Use _add_with_viewport() for
+       scrolled window contents.
+
 1998-12-07  Federico Mena Quintero  <federico@nuclecu.unam.mx>
 
        * gtk/gtkpaned.h (struct _GtkPaned): Removed the unused cursor
index 7f26956e6b108f9d5e60ac3fc069ce7ddb84e418..b43cd4ae848ddc9ae8407d7ab1fd0e217b62cb3d 100644 (file)
@@ -1,3 +1,15 @@
+Mon Dec  7 13:38:06 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkimage.c (gdk_image_new): Use IPC_RMID
+       _after_ doing XShmAttach. This should work everywhere,
+       and avoid the need for signal handlers or configure
+       checks.
+
+Thu Dec  3 19:58:45 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkinputdialog.c: Use _add_with_viewport() for
+       scrolled window contents.
+
 1998-12-07  Federico Mena Quintero  <federico@nuclecu.unam.mx>
 
        * gtk/gtkpaned.h (struct _GtkPaned): Removed the unused cursor
index 7f26956e6b108f9d5e60ac3fc069ce7ddb84e418..b43cd4ae848ddc9ae8407d7ab1fd0e217b62cb3d 100644 (file)
@@ -1,3 +1,15 @@
+Mon Dec  7 13:38:06 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkimage.c (gdk_image_new): Use IPC_RMID
+       _after_ doing XShmAttach. This should work everywhere,
+       and avoid the need for signal handlers or configure
+       checks.
+
+Thu Dec  3 19:58:45 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkinputdialog.c: Use _add_with_viewport() for
+       scrolled window contents.
+
 1998-12-07  Federico Mena Quintero  <federico@nuclecu.unam.mx>
 
        * gtk/gtkpaned.h (struct _GtkPaned): Removed the unused cursor
index 8e62fef6643fe6603fa5e5232f8f3379d8c49d9d..5d48182d93f0f60589b99254c18b7fb38e4b1171 100644 (file)
@@ -235,11 +235,6 @@ gdk_image_new (GdkImageType  type,
                  return NULL;
                }
 
-#ifdef IPC_RMID_DEFERRED_RELEASE
-             if (x_shm_info->shmaddr != (char*) -1)
-               shmctl (x_shm_info->shmid, IPC_RMID, 0);                      
-#endif
-
              gdk_error_code = 0;
              gdk_error_warnings = 0;
 
@@ -260,6 +255,14 @@ gdk_image_new (GdkImageType  type,
                  gdk_use_xshm = False;
                  return NULL;
                }
+             
+             /* We mark the segment as destroyed so that when
+              * the last process detaches, it will be deleted.
+              * There is a small possibility of leaking if
+              * we die in XShmAttach. In theory, a signal handler
+              * could be set up.
+              */
+             shmctl (x_shm_info->shmid, IPC_RMID, 0);                
 
              if (image)
                image_list = g_list_prepend (image_list, image);
@@ -417,7 +420,6 @@ gdk_image_destroy (GdkImage *image)
 
       x_shm_info = private->x_shm_info;
       shmdt (x_shm_info->shmaddr);
-      shmctl (x_shm_info->shmid, IPC_RMID, 0);
       
       g_free (private->x_shm_info);
 
index 8e62fef6643fe6603fa5e5232f8f3379d8c49d9d..5d48182d93f0f60589b99254c18b7fb38e4b1171 100644 (file)
@@ -235,11 +235,6 @@ gdk_image_new (GdkImageType  type,
                  return NULL;
                }
 
-#ifdef IPC_RMID_DEFERRED_RELEASE
-             if (x_shm_info->shmaddr != (char*) -1)
-               shmctl (x_shm_info->shmid, IPC_RMID, 0);                      
-#endif
-
              gdk_error_code = 0;
              gdk_error_warnings = 0;
 
@@ -260,6 +255,14 @@ gdk_image_new (GdkImageType  type,
                  gdk_use_xshm = False;
                  return NULL;
                }
+             
+             /* We mark the segment as destroyed so that when
+              * the last process detaches, it will be deleted.
+              * There is a small possibility of leaking if
+              * we die in XShmAttach. In theory, a signal handler
+              * could be set up.
+              */
+             shmctl (x_shm_info->shmid, IPC_RMID, 0);                
 
              if (image)
                image_list = g_list_prepend (image_list, image);
@@ -417,7 +420,6 @@ gdk_image_destroy (GdkImage *image)
 
       x_shm_info = private->x_shm_info;
       shmdt (x_shm_info->shmaddr);
-      shmctl (x_shm_info->shmid, IPC_RMID, 0);
       
       g_free (private->x_shm_info);
 
index 0d68b2b1c50644a27be8c5991fa68890d204f7c0..5eac29bbda3624023b78324f0a7b380e3fee327d 100644 (file)
@@ -506,7 +506,8 @@ gtk_input_dialog_fill_axes(GtkInputDialog *inputd, GdkDeviceInfo *info)
       gtk_widget_destroy (inputd->axis_list);
     }
   inputd->axis_list = gtk_table_new (GDK_AXIS_LAST, 2, 0);
-  gtk_container_add (GTK_CONTAINER (inputd->axis_listbox), inputd->axis_list);
+  gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (inputd->axis_listbox), 
+                                        inputd->axis_list);
   gtk_widget_show (inputd->axis_list);
 
   gtk_widget_realize (inputd->axis_list);
@@ -641,7 +642,8 @@ gtk_input_dialog_fill_keys(GtkInputDialog *inputd, GdkDeviceInfo *info)
     }
 
   inputd->keys_list = gtk_table_new (info->num_keys, 3, FALSE);
-  gtk_container_add (GTK_CONTAINER (inputd->keys_listbox), inputd->keys_list);
+  gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (inputd->keys_listbox), 
+                                        inputd->keys_list);
   gtk_widget_show (inputd->keys_list);
 
   gtk_widget_realize (inputd->keys_list);